#include <iostream>
#include <vector>
using namespace std;

void f(int n, vector<int> &buffer, int l, vector<int> &vis) {
  if (l == n) {
    for (int i = 0; i < l; i++) {
      if (i)
        cout << " ";
      cout << buffer[i];
    }
    cout << endl;
    return;
  }

  for (int i = 1; i <= n; i++) {
    if (vis[i])
      continue;
    buffer[l] = i;
    vis[i] = 1;
    f(n, buffer, l + 1, vis);
    vis[i] = 0;
  }
}

int main() {
  int n;
  cin >> n;
  //  int buffer[n];
  vector<int> buffer(n);
  vector<int> vis(n, 0);
  // int *vis = (int *)calloc(n, sizeof(int));
    for(auto x : vis) cout << x << " ";
  //f(n, buffer, 0, vis);

  return 0;
}